package main

import (
	"02-grpc/hello"
	// "encoding/json"
	"fmt"

	"google.golang.org/protobuf/proto"
)

type Hello struct {
	Name string `json:"name"`
}

func main() {
	req := hello.Hello{
		Name: "QDGZ",
	}

	// jsonStruct := Hello{Name: "QDGZ"}
	// jsonRsp, _ := json.Marshal(jsonStruct)
	// fmt.Println(jsonRsp)

	rsp, _ := proto.Marshal(&req)
	fmt.Println(rsp)

	newReq := hello.Hello{}
	proto.Unmarshal(rsp, &newReq)
	fmt.Println(newReq.Name)

}
